/*
 * @(#)NotificationEvent.java 创建于 2015-10-28 15:04:20
 *
 * 版权：版权所有 Bsoft 保留所有权力。
 */
package com.bsoft.gol.hbs.bbpmessagel.notification.event;

import hcn.enums.InformTypeEnum;
import com.bsoft.gol.hbs.bbpmessagel.enums.RoleIdEnum;
import java.io.Serializable;
import java.util.*;

/**
 * 通过device推送时, 不再判断租户, 通过身份证, 卡, mpiId, doctorId这些推送时必须要传递租户。
 *
 * @author <a href="mailto:chinnsii@163.com">zhengshi</a>
 */
public class NotificationEvent implements Serializable {

    private String title;
    private String content;
    private NotificateType notificateType;
    // @@ 当同一个类别的消息里包含有多个不同的子类别时一定要设置这个属性,比如报告提醒,有检查报告提醒和检验报告提醒.
    private String affairType;
    private long businessKey;
    private Map<String, String> extras = new HashMap<>();
    private String[] idCards;
    private String[] doctorIds;
    private String[] mpiIds;
    private String sound = "default";
    // @@ 可选, 当推送的事件是否可以操作与NotificateType中预定义的一不致时使用此项属性来覆盖.
    private byte operationable;
    private long delay = 0L;
    private List<String> tenantIds = new ArrayList<>();

    public NotificationEvent(String title, NotificateType notificateType) {
        this.title = title;
        this.notificateType = notificateType;
        operationable = notificateType.isOperationable();
    }

    public NotificationEvent(String title, NotificateType notificateType, boolean operationable) {
        this(title, notificateType);
        setOperationable(operationable);
    }

    public String getTitle() {
        return title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public NotificateType getNotificateType() {
        return notificateType;
    }

    public Map<String, String> getExtras() {
        return extras;
    }

    public void setExtras(Map<String, String> extras) {
        this.extras = extras;
    }

    public void addExtra(String name, String value) {
        extras.put(name, value);
    }

    public String getAffairType() {
        return affairType;
    }

    public void setAffairType(String affairType) {
        this.affairType = affairType;
    }

    public long getBusinessKey() {
        return businessKey;
    }

    public void setBusinessKey(long businessKey) {
        this.businessKey = businessKey;
    }

    public byte getOperationable() {
        return operationable;
    }

    public void setOperationable(boolean operationable) {
        this.operationable = (byte) (operationable ? 1 : 0);
    }

    public String[] getMpiIds() {
        return mpiIds;
    }

    /**
     * 只对患者版有效.
     *
     * @param mpiIds
     * @param tenantId
     */
    public void setMpiIds(String[] mpiIds, String tenantId) {
        this.mpiIds = mpiIds;
        this.addTenantId(tenantId);
    }

    /**
     * 只对患者版有效.
     *
     * @param mpiIds
     * @param tenantIds
     */
    public void setMpiIds(String[] mpiIds, String[] tenantIds) {
        this.mpiIds = mpiIds;
        if (tenantIds.length > 0) {
            Collections.addAll(this.tenantIds, tenantIds);
        }
    }

    /**
     * 只对患者版有效.
     *
     * @param mpiIds
     * @param tenantIds
     */
    public void setMpiIds(String[] mpiIds, List<String> tenantIds) {
        this.mpiIds = mpiIds;
        if (!tenantIds.isEmpty()) {
            this.tenantIds.addAll(tenantIds);
        }
    }

    public String[] getIdCards() {
        return idCards;
    }

    /**
     * 对患者版和医生版都有效.
     *
     * @param idCards
     */
    public void setIdCards(String[] idCards, String tenantId) {
        this.idCards = idCards;
        this.addTenantId(tenantId);
    }

    /**
     * 对患者版和医生版都有效.
     *
     * @param idCards
     * @param tenantIds
     */
    public void setIdCards(String[] idCards, String[] tenantIds) {
        this.idCards = idCards;
        if (tenantIds.length > 0) {
            Collections.addAll(this.tenantIds, tenantIds);
        }
    }

    /**
     * 对患者版和医生版都有效.
     *
     * @param idCards
     * @param tenantIds
     */
    public void setIdCards(String[] idCards, List<String> tenantIds) {
        this.idCards = idCards;
        if (!tenantIds.isEmpty()) {
            this.tenantIds.addAll(tenantIds);
        }
    }

    public String[] getDoctorIds() {
        return doctorIds;
    }

    /**
     * 只对医生版有效.
     *
     * @param doctorIds
     */
    public void setDoctorIds(String[] doctorIds, String tenantId) {
        this.doctorIds = doctorIds;
        this.addTenantId(tenantId);
    }

    /**
     * 只对医生版有效.
     *
     * @param doctorIds
     */
    public void setDoctorIds(String[] doctorIds, String[] tenantIds) {
        this.doctorIds = doctorIds;
        if (tenantIds.length > 0) {
            Collections.addAll(this.tenantIds, tenantIds);
        }
    }

    /**
     * 只对医生版有效.
     *
     * @param doctorIds
     */
    public void setDoctorIds(String[] doctorIds, List<String> tenantIds) {
        this.doctorIds = doctorIds;
        if (!tenantIds.isEmpty()) {
            this.tenantIds.addAll(tenantIds);
        }
    }

    public String getSound() {
        return sound;
    }

    /**
     * 设置声音, null表示不响铃。
     *
     * @param sound
     */
    public void setSound(String sound) {
        this.sound = sound;
    }

    /**
     * @return the tenant ids that need to notify.
     */
    public List<String> getTenantIds() {
        return tenantIds;
    }

    /**
     * @param tenantIds the tenant ids that need to notify.
     */
    public void setTenantIds(List<String> tenantIds) {
        this.tenantIds = tenantIds;
    }

    /**
     * @param tenantId the tenant id to add.
     */
    public void addTenantId(String tenantId) {
        tenantIds.add(tenantId);
    }

    public long getDelay() {
        return delay;
    }

    public void setDelay(long delay) {
        this.delay = delay;
    }

    public enum NotificateType implements Serializable {

        /**
         * @@ 系统控制消息(业务发生的推送不要用这个)-医生
         */
        patientAppControl(RoleIdEnum.PATIENT.title(), "01", "001", false, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统控制消息(业务发生的推送不要用这个)-患者
         */
        doctorAppControl(RoleIdEnum.DOCTOR.title(), "01", "002", false, false, null),
        /**
         * @@ 系统通知->数据完善-患者
         */
        profile(RoleIdEnum.PATIENT.title(), "01", "003", true, true, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统通知->家庭管理-患者
         */
        family(RoleIdEnum.PATIENT.title(), "01", "004", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统通知->意见反馈-患者
         */
        feedback(RoleIdEnum.PATIENT.title(), "01", "005", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统通知->意见反馈-医生
         */
        doctFeedback(RoleIdEnum.DOCTOR.title(), "01", "006", true, false, null),
        /**
         * @@ 系统通知->用户申诉
         */
        userAppeal(RoleIdEnum.PATIENT.title(), "01", "007", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统通知->手工批量消息推送
         */
        patientPushMsg(RoleIdEnum.PATIENT.title(), "01", "233", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统通知-复诊预约居民提醒信息
         */
        patient_returnvisit_doctor(RoleIdEnum.PATIENT.title(), "01", "235", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 系统通知-复诊预约-居民支付有效期2小时提醒信息
         */
        patient_returnvisit_notify_pay(RoleIdEnum.PATIENT.title(), "01", "236", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 预约挂号->预约成功(就医通知)
         */
        appointment_patient(RoleIdEnum.PATIENT.title(), "02", "008", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 预约挂号->挂号预约通知(就医通知)
         */
        oa_appt_succ_pay(RoleIdEnum.PATIENT.title(), "02", "006", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 预约挂号->挂号改约通知(就医通知)
         */
        oa_appt_chang(RoleIdEnum.PATIENT.title(), "02", "221", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 预约挂号->挂号取消预约通知(就医通知)
         */
        oa_appt_cxl(RoleIdEnum.PATIENT.title(), "02", "002", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 预约挂号->预约挂号成功(就医通知)
         */
        appointment_success_patient(RoleIdEnum.PATIENT.title(), "02", "009", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 预约挂号->预约挂号失败(就医通知)
         */
        appointment_fail_patient(RoleIdEnum.PATIENT.title(), "02", "010", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 预约挂号->取消预约挂号成功(就医通知)
         */
        cancel_appointment_patient(RoleIdEnum.PATIENT.title(), "02", "011", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 预约挂号->预约提醒：预约时间的前一天(就医通知)
         */
        appointment_remind_patient(RoleIdEnum.PATIENT.title(), "02", "012", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 预约挂号->预约提醒：医院停诊(就医通知)
         */
        stop_diagnosis_patient(RoleIdEnum.PATIENT.title(), "02", "013", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 排队叫号->(HIS门诊医生点叫号，提前三个号提醒用户)(就医通知)
         */
        queue(RoleIdEnum.PATIENT.title(), "03", "014", true, true, InformTypeEnum.OFFLINE_SERVICE),
        cn_to_call(RoleIdEnum.PATIENT.title(), "03", "029", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 门诊缴费->HIS门诊医生开完单，推送消息(推送待支付列表   就医通知)
         */
        outpatient_fee_patient(RoleIdEnum.PATIENT.title(), "04", "015", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 报告提醒->报告审核后(就医通知)
         */
        report(RoleIdEnum.PATIENT.title(), "05", "016", true, true, InformTypeEnum.REPORT_REMIND),

        /**
         * @@ 报告提醒->报告历史查询(就医通知)
         */
        reportHistory(RoleIdEnum.PATIENT.title(), "05", "017", true, false, InformTypeEnum.REPORT_REMIND),

        /**
         * @@ 重要事件->危急值提醒(就医通知)
         */
        criticalValue(RoleIdEnum.PATIENT.title(), "12", "022", true, false, InformTypeEnum.REPORT_REMIND),

        /**
         * @@ 报告提醒->报告解读退回提醒(就医通知)
         */
        reportAnalysisRefused(RoleIdEnum.PATIENT.title(), "05", "018", true, true, InformTypeEnum.REPORT_REMIND),

        /**
         * @@ 报告提醒->报告解读完成提醒(就医通知)
         */
        reportAnalysisCompleted(RoleIdEnum.PATIENT.title(), "05", "019", true, true, InformTypeEnum.REPORT_REMIND),

        /**
         * @@ 评价记录->预约记录已就诊-待评价(就医通知)
         */
        evaluation_treatment_patient(RoleIdEnum.PATIENT.title(), "06", "020", true, true, InformTypeEnum.MSQ_INSPECT),

        /**
         * @@ 账单通知->(住院日清单出来后，推送消息)(就医通知)
         */
        bill_patient(RoleIdEnum.PATIENT.title(), "07", "021", true, true, InformTypeEnum.ORDER_REMIND),

        /**
         * @@ 服务通知->病史收集(就医通知)
         */
        medicalHistory(RoleIdEnum.PATIENT.title(), "08", "023", true, true, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 服务通知->复诊超时提醒(就医通知)
         */
        referral(RoleIdEnum.PATIENT.title(), "08", "024", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 服务通知->产检提醒
         */
        pregnancy(RoleIdEnum.PATIENT.title(), "08", "025", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 服务通知->计免提醒
         */
        vaccination(RoleIdEnum.PATIENT.title(), "08", "026", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 服务通知->儿保提醒
         */
        childCare(RoleIdEnum.PATIENT.title(), "08", "027", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 服务通知->医生回复
         */
        doctorReply(RoleIdEnum.PATIENT.title(), "08", "028", true, true, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 服务通知->用药提醒()
         */
//        drugUse(RoleIdEnum.PATIENT.title(), "20", "029", true, false),

        /**
         * @@ 服务通知->住院病情推送
         */
        inHospital(RoleIdEnum.PATIENT.title(), "08", "030", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 签约审核->签约消息通知
         */
        sign_patient(RoleIdEnum.PATIENT.title(), "09", "031", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 办公通讯->会议通知
         */
        meeting(RoleIdEnum.DOCTOR.title(), "10", "032", true, false, null),
        /**
         * @@ 办公通讯->院内公告
         */
        announcement(RoleIdEnum.DOCTOR.title(), "10", "033", true, false, null),
        /**
         * @@ 办公通讯->即时消息
         */
        im(RoleIdEnum.DOCTOR.title(), "10", "034", true, true, null),
        /**
         * @@ 系统通知->手工批量消息推送
         */
        doctorPushMsg(RoleIdEnum.DOCTOR.title(), "10", "234", true, false, InformTypeEnum.SYSTEM_SWITCH),
        /**
         * @@ 在线审批->请假审批
         */
        askForLeave(RoleIdEnum.DOCTOR.title(), "11", "035", true, true, null),
        /**
         * @@ 在线审批->医疗审批
         */
        medicalApproval(RoleIdEnum.DOCTOR.title(), "11", "036", true, true, null),
        /**
         * @@ 报告解读->检验报告解读
         */
        reportAnalysis(RoleIdEnum.DOCTOR.title(), "05", "037", true, true, null),
        /**
         * @@ 咨询挂号->咨询挂号
         */
        appointment_doctor(RoleIdEnum.DOCTOR.title(), "02", "038", true, false, null),
        /**
         * @@ 重要事件->危机值提醒
         */
        criticalWarn(RoleIdEnum.DOCTOR.title(), "12", "039", true, true, null),

        /**
         * @@ 签约消息通知->居民签约申请，取消签约
         */
        sign_doctor(RoleIdEnum.DOCTOR.title(), "09", "040", true, false, null),

        /**
         * @@ 咨询互动->咨询互动消息(家医)
         */
        advisory_doctor(RoleIdEnum.DOCTOR.title(), "13", "041", true, true, null),

        /**
         * @@ 咨询互动->咨询互动消息(居民)
         */
        advisory_patient(RoleIdEnum.PATIENT.title(), "13", "042", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 健康监测->健康监测消息(家医)
         */
        hm_doctor(RoleIdEnum.DOCTOR.title(), "14", "043", true, true, null),

        /**
         * @@ 健康监测->健康监测消息(居民)
         */
        hm_patient(RoleIdEnum.PATIENT.title(), "14", "044", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 健康活动->健康活动消息(居民)
         */
        health_activities_patient(RoleIdEnum.PATIENT.title(), "15", "045", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 服务记录->服务记录消息(居民)
         */
        service_exe_patient(RoleIdEnum.PATIENT.title(), "16", "046", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 解除签约
         */
        remove_sign_patient(RoleIdEnum.DOCTOR.title(), "09", "047", true, true, null),

        /**
         * @@ 提交解约申请
         */
        relieve_sign_apply_doctor(RoleIdEnum.DOCTOR.title(), "09", "058", true, true, null),

        /**
         * @@ 商品分享
         */
        share_products_patient(RoleIdEnum.PATIENT.title(), "17", "048", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 家医通知
         */
        doctor_notification(RoleIdEnum.PATIENT.title(), "18", "049", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 居民转诊推送
         */
        referral_patient_notification(RoleIdEnum.PATIENT.title(), "19", "050", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 居民设置用药提醒, 推送药事服务用药提醒消息
         */
        patient_Medication_Reminder(RoleIdEnum.PATIENT.title(), "20", "051", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 计划免疫提醒，推送提醒用药消息
         */
        patient_Immunity_Reminder(RoleIdEnum.PATIENT.title(), "20", "052", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 上门服务-居民申请,取消申请,过期自动取消提醒
         */
        doctor_home_service(RoleIdEnum.DOCTOR.title(), "21", "053", true, false, null),

        /**
         * @@ 上门服务-医生接单通知
         */
        patient_home_service(RoleIdEnum.PATIENT.title(), "21", "054", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 轻问诊-医生信息提醒
         */
        doctor_consultAsk(RoleIdEnum.DOCTOR.title(), "22", "055", true, false, null),

        /**
         * @@ 轻问诊-居民提醒信息
         */
        patient_consultAsk(RoleIdEnum.PATIENT.title(), "22", "056", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 轻问诊-患者视频提醒
         */
        patient_ConsultAsk_Video(RoleIdEnum.PATIENT.title(), "22", "057", true, true, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 住院服务-开出住院证通知患者
         */
        patient_open_prove(RoleIdEnum.PATIENT.title(), "23", "059", true, true, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 住院服务-住院预约成功通知患者
         */
        patient_appointment_confirm(RoleIdEnum.PATIENT.title(), "23", "060", true, true, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院->医院床位变化通知(就医通知)
         */
        ha_confirmed(RoleIdEnum.PATIENT.title(), "23", "223", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院->留言消息通知居民
         */
        leave_message(RoleIdEnum.PATIENT.title(), "23", "227", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院->留言消息通知医生
         */
        leave_message_doctor(RoleIdEnum.DOCTOR.title(), "23", "227", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 电子健康卡->消息
         */
        ehc_Verify(RoleIdEnum.PATIENT.title(), "24", "061", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * @@ 住院服务->出院结算通知消息
         */
        discharge_settlement(RoleIdEnum.PATIENT.title(), "23", "062", true, false, InformTypeEnum.PAY_INFORM),
        /**
         * @@ 系统通知->家庭管理-患者
         */
        realNameVerify(RoleIdEnum.PATIENT.title(), "01", "063", true, false, InformTypeEnum.SYSTEM_SWITCH),

        /**
         * @@ 健康档案->档案迁移消息
         */
        doctor_migration(RoleIdEnum.DOCTOR.title(), "25", "064", true, false, null),

        /**
         * @@ 住院服务->手术推送通知
         */
        patient_operation(RoleIdEnum.PATIENT.title(), "23", "065", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->手术已申请
         */
        sg_applyed(RoleIdEnum.PATIENT.title(), "23", "215", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->手术申请已撤销
         */
        sg_applyed_cancel(RoleIdEnum.PATIENT.title(), "23", "216", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->手术已安排
         */
        sg_srg_arranged(RoleIdEnum.PATIENT.title(), "23", "217", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->手术安排已取消
         */
        sg_srg_arranged_cancel(RoleIdEnum.PATIENT.title(), "23", "218", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->手术已完成
         */
        sg_backward(RoleIdEnum.PATIENT.title(), "23", "219", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->医生手术已安排
         */
        doc_sg_srg_arranged(RoleIdEnum.DOCTOR.title(), "23", "229", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * @@ 住院服务->手术安排已取消
         */
        doc_sg_srg_arranged_cancel(RoleIdEnum.DOCTOR.title(), "23", "228", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * 云诊室 系统消息
         */
        clinic_msg("clinic", "01", "063", true, true, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 医生 转诊通知
         */
        clinic_transfer(RoleIdEnum.DOCTOR.title(), "42", "421", true, true, InformTypeEnum.SYSTEM_SWITCH),

        /**
         * 患者 转诊通知
         */
        clinic_transfer_patient(RoleIdEnum.PATIENT.title(), "42", "422", true, true, InformTypeEnum.SYSTEM_SWITCH),

        /**
         * @@ 复诊配药-医生信息提醒
         */
        doctor_returnVisit(RoleIdEnum.DOCTOR.title(), "26", "066", true, false, null),

        /**
         * @@ 复诊配药-居民提醒信息
         */
        patient_returnVisit(RoleIdEnum.PATIENT.title(), "26", "067", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 复诊配药-患者视频提醒
         */
        patient_returnVisit_video(RoleIdEnum.PATIENT.title(), "26", "068", true, true, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-医生超时未接诊提示居民
         */
        patient_cloudClinic_overtime(RoleIdEnum.PATIENT.title(), "27", "069", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-预约提醒:预约时间的前N分钟,N可参数设置
         */
        patient_cloudClinic_remind(RoleIdEnum.PATIENT.title(), "27", "070", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-排队提醒:病人前面还有M/N个号
         */
        patient_cloudClinic_queue(RoleIdEnum.PATIENT.title(), "27", "071", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-取消预约:患者主动取消预约
         */
        patient_cloudClinic_patientCancel(RoleIdEnum.PATIENT.title(), "27", "072", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-医生主动取消提醒:医生主动拒绝
         */
        patient_cloudClinic_doctorCancel(RoleIdEnum.PATIENT.title(), "27", "073", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-预约提醒:当前正在叫号病人号码
         */
        patient_cloudClinic_beCalled(RoleIdEnum.PATIENT.title(), "27", "074", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-医生已确认接诊
         */
        patient_cloudClinic_accept(RoleIdEnum.PATIENT.title(), "27", "075", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-处方审核-审核通过
         */
        patient_cloudClinic_prescriptionAuditPass(RoleIdEnum.PATIENT.title(), "27", "076", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 云诊室-处方审核-审核未通过
         */
        doctor_cloudClinic_prescriptionAuditFailed(RoleIdEnum.DOCTOR.title(), "27", "077", true, false, null),

        /**
         * @@ 云诊室-处方审核-处方过期提醒
         */
        patient_cloudClinic_prescriptionExpire(RoleIdEnum.PATIENT.title(), "27", "078", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 复诊配药-处方审核-审核通过
         */
        patient_returnVisit_prescriptionAuditPass(RoleIdEnum.PATIENT.title(), "26", "079", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * @@ 复诊配药-处方审核-审核未通过
         */
        doctor_returnVisit_prescriptionFailed(RoleIdEnum.DOCTOR.title(), "26", "080", true, true, null),

        /**
         * @@ 复诊配药-处方审核-处方过期提醒
         */
        patient_returnVisit_prescriptionExpire(RoleIdEnum.PATIENT.title(), "26", "081", true, true, InformTypeEnum.INTERNET_TREAT),


        /**
         * @@ 复诊配药-处方审核-审核通过,医生推送
         */
        doctor_returnVisit_prescriptionAuditPass(RoleIdEnum.DOCTOR.title(), "26", "082", true, false, null),

        /**
         * @@ 健康随访-视频推送提醒患者
         */
        patient_visit_remind(RoleIdEnum.PATIENT.title(), "28", "083", true, false, InformTypeEnum.INTERNET_TREAT),

        /**
         * 电子通行证-提醒患者
         */
        /**
         * 激活电子通行证
         */
        ele_active_patient(RoleIdEnum.PATIENT.title(), "29", "084", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 失效电子通行证
         */
        ele_fail_patient(RoleIdEnum.PATIENT.title(), "29", "085", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 注销电子通行证
         */
        ele_cancel_patient(RoleIdEnum.PATIENT.title(), "29", "086", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 审核电子通行证
         */
        ele_audit_patient(RoleIdEnum.PATIENT.title(), "29", "087", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 待审核电子通行证
         */
        ele_audit_doctor(RoleIdEnum.DOCTOR.title(), "29", "091", true, false, null),

        /**
         * 失效电子通行证
         */
        ele_fail_doctor(RoleIdEnum.DOCTOR.title(), "29", "092", true, false, null),
        /**
         * 激活电子通行证
         */
        ele_active_doctor(RoleIdEnum.DOCTOR.title(), "29", "093", true, false, null),
        /**
         * 随访路径中设置的提前通知时间
         */
        follow_up_task_notice(RoleIdEnum.PATIENT.title(), "30", "088", true, false, InformTypeEnum.MSQ_INSPECT),
        /**
         * 慢病入组审核通过
         */
        follow_up_approved(RoleIdEnum.PATIENT.title(), "30", "089", true, false, InformTypeEnum.MSQ_INSPECT),
        /**
         * 慢病入组审核不通过
         */
        follow_up_audit_no_pass(RoleIdEnum.PATIENT.title(), "30", "090", true, false, InformTypeEnum.MSQ_INSPECT),

        /**
         * 投诉建议提交
         */
        sugg_tobe_commit(RoleIdEnum.DOCTOR.title(),"31","094",true,false,InformTypeEnum.MSQ_INSPECT),

        /**
         * 投诉建议审核,推给居民
         */
        sugg_tobe_repl(RoleIdEnum.PATIENT.title(),"31","095",true,false,InformTypeEnum.MSQ_INSPECT),


        /**
         * 投诉建议审核,推给医生
         */
        sugg_tobe_doctor_repl(RoleIdEnum.DOCTOR.title(),"31","099",true,false,InformTypeEnum.MSQ_INSPECT),

        /**
         * 上门护理
         */
        home_care_notice(RoleIdEnum.DOCTOR.title(), "32", "096", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 满意度调查问卷已处理
         */
        satisfaction_survey(RoleIdEnum.DOCTOR.title(), "33", "097", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 医生端针对满意度调查问卷所有问题点已提交处理
         */
        satisfaction_survey_processed(RoleIdEnum.PATIENT.title(), "33", "098", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         *检验预约已取消
         */
        lis_appointed_cancel(RoleIdEnum.PATIENT.title(), "34", "099", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 检验已完成预约
         */
        lis_appointed(RoleIdEnum.PATIENT.title(), "34", "100", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * 医生排班信息推送通知
         */
        send_doctor_scheduling(RoleIdEnum.DOCTOR.title(), "34", "226", true, false, InformTypeEnum.OFFLINE_SERVICE),


        /**
         * 发送检查预约信息 MRC确认预约后，发送检查预约信息到集成平台，集成平台再把预约信息分发到HIS和PACS。
         */
        lis_exmappointsubmit(RoleIdEnum.PATIENT.title(), "36", "224", true, false, InformTypeEnum.OFFLINE_SERVICE),
        exmappointsubmit_change(RoleIdEnum.PATIENT.title(), "36", "224", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * MRC取消预约时，发送消息到集成平台。
         */
        updateexmrequeststatus_mrc_cancel(RoleIdEnum.PATIENT.title(), "36", "225", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 科室停采后消息通知预约患者，预约终端可通过<预约日期查询>接口查询停采信息
         */
        lis_appointed_suspend(RoleIdEnum.PATIENT.title(), "34", "101", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 通知采血取号 患者预约采集执行后，通知APP端并发送排队信息
         */
        lis_appointed_queue(RoleIdEnum.PATIENT.title(), "34", "102", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * 病历复印-审核通过
         */
        medical_record_copy(RoleIdEnum.PATIENT.title(), "35", "103", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 病历复印-取消
         */
        medical_record_copy_cancel(RoleIdEnum.PATIENT.title(), "35", "104", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 病历复印-审核不通过
         */
        medical_record_copy_notpass(RoleIdEnum.PATIENT.title(), "35", "105", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * 抗菌药物-审核完成通知
         */
        antibacterial_review_completed(RoleIdEnum.DOCTOR.title(), "37", "106", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 抗菌药物-新增申请
         */
        antibacterial_apply_new(RoleIdEnum.DOCTOR.title(), "37", "107", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * 预防接种-停诊
         */
        reg_vaccine_stop_work(RoleIdEnum.PATIENT.title(), "39", "108", true, false, InformTypeEnum.REG_VACCINE),
        /**
         * 预防接种-签到
         */
        reg_vaccine_taking(RoleIdEnum.PATIENT.title(), "39", "109", true, false, InformTypeEnum.REG_VACCINE),
        /**
         * 预防接种-取消
         */
        reg_vaccine_cancel(RoleIdEnum.PATIENT.title(), "39", "110", true, false, InformTypeEnum.REG_VACCINE),
        /**
         * 病历质控提醒
         */
        doc_case_quality_remind(RoleIdEnum.PATIENT.title(), "40", "230", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         * 院内会诊通知
         */
        doc_hospital_consult(RoleIdEnum.PATIENT.title(), "41", "231", true, false, InformTypeEnum.OFFLINE_SERVICE),
        /**
         *院内会诊意见通知
         */
        doc_hospital_consult_point(RoleIdEnum.PATIENT.title(), "41", "232", true, false, InformTypeEnum.OFFLINE_SERVICE),

        /**
         * 专科随访->病例订阅提醒
         */
        subscribe_medical_remind(RoleIdEnum.DOCTOR.title(),"43","237",true,false,InformTypeEnum.OFFLINE_SERVICE);

        /*注意，大类group、小类typeCode从excel文件里面维护 小类已经添加到了230，往上看*/

        private String roleId;
        private String group;
        private String typeCode;
        private boolean persistent;
        private boolean operationable;
        private InformTypeEnum messageRegion;

        NotificateType(String roleId, String group, String typeCode, boolean persistent, boolean operationable, InformTypeEnum messageRegion) {
            this.roleId = roleId;
            this.group = group;
            this.typeCode = typeCode;
            this.persistent = persistent;
            this.messageRegion = messageRegion;
        }

        public String getRoleId() {
            return roleId;
        }

        public String getGroup() {
            return group;
        }

        public String getTypeCode() {
            return typeCode;
        }

        public boolean isPersistent() {
            return persistent;
        }

        public byte isOperationable() {
            return (byte) (operationable ? 1 : 0);
        }

        public InformTypeEnum getMessageRegion() {
            return messageRegion;
        }

        public void setMessageRegion(InformTypeEnum messageRegion) {
            this.messageRegion = messageRegion;
        }

        public void setRoleId(String roleId) {
            this.roleId = roleId;
        }

        public void setGroup(String group) {
            this.group = group;
        }

        public void setTypeCode(String typeCode) {
            this.typeCode = typeCode;
        }

        public void setPersistent(boolean persistent) {
            this.persistent = persistent;
        }

        public void setOperationable(boolean operationable) {
            this.operationable = operationable;
        }
    }
}
